$(function () {
  $('a[href="#topic-preview"]').on('show.bs.tab',
    function (e) {
      $.post("/api/document/markdown/parser",
        {
          content: $('#topic-editor textarea').val()
        },
        function (data, status) {
          if (status == 'success') $('.topic-preview').html(data);
          else alert("文档解析Markdown失败");
        });
    });
});
